Skip to content

Some Suggested Improvements for Text Tool#4355

Open
thermalPasteMilkshake wants to merge 7 commits into
GraphiteEditor:masterfrom
thermalPasteMilkshake:master
Open

Some Suggested Improvements for Text Tool#4355
thermalPasteMilkshake wants to merge 7 commits into
GraphiteEditor:masterfrom
thermalPasteMilkshake:master

Conversation

@thermalPasteMilkshake

@thermalPasteMilkshake thermalPasteMilkshake commented Jul 21, 2026

Copy link
Copy Markdown

Hello, This fixes #4328
(this is just a rough fix, I just wanted to ask some stuff out alongside it)
Im also requesting guidance on the outer border removal as I stated in the discussions for the issue.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Confidence score: 2/5

  • In editor/src/messages/tool/tool_messages/select_tool.rs, the Deepest-selection edit handler is replaced with an empty block, which appears to disable double-click-to-edit for text/path layers and leaves edit_layer_deepest_manipulation effectively unused; merging as-is likely causes a clear editing workflow regression in the default selection mode — restore or rewire the Deepest edit path (and verify with a focused interaction test) before merging.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="editor/src/messages/tool/tool_messages/select_tool.rs">

<violation number="1" location="editor/src/messages/tool/tool_messages/select_tool.rs:1129">
P1: Replacing the Deepest-selection edit handler with an empty block silently disables double-click-to-edit for text/path layers in the default 'Deepest' selection mode, and leaves `edit_layer_deepest_manipulation` as dead code. This looks like leftover debugging rather than an intentional fix and should be reverted or reworked.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

match tool_data.nested_selection_behavior {
NestedSelectionBehavior::Shallowest => edit_layer_shallowest_manipulation(document, intersect, responses),
NestedSelectionBehavior::Deepest => edit_layer_deepest_manipulation(intersect, &document.network_interface, responses),
NestedSelectionBehavior::Deepest => {}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Replacing the Deepest-selection edit handler with an empty block silently disables double-click-to-edit for text/path layers in the default 'Deepest' selection mode, and leaves edit_layer_deepest_manipulation as dead code. This looks like leftover debugging rather than an intentional fix and should be reverted or reworked.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At editor/src/messages/tool/tool_messages/select_tool.rs, line 1129:

<comment>Replacing the Deepest-selection edit handler with an empty block silently disables double-click-to-edit for text/path layers in the default 'Deepest' selection mode, and leaves `edit_layer_deepest_manipulation` as dead code. This looks like leftover debugging rather than an intentional fix and should be reverted or reworked.</comment>

<file context>
@@ -1125,7 +1126,7 @@ impl Fsm for SelectToolFsmState {
 					match tool_data.nested_selection_behavior {
 						NestedSelectionBehavior::Shallowest => edit_layer_shallowest_manipulation(document, intersect, responses),
-						NestedSelectionBehavior::Deepest => edit_layer_deepest_manipulation(intersect, &document.network_interface, responses),
+						NestedSelectionBehavior::Deepest => {}
 					}
 				}
</file context>
Suggested change
NestedSelectionBehavior::Deepest => {}
NestedSelectionBehavior::Deepest => edit_layer_deepest_manipulation(intersect, &document.network_interface, responses),

@thermalPasteMilkshake

thermalPasteMilkshake commented Jul 23, 2026

Copy link
Copy Markdown
Author

update:
Ive changed 3 things that I assume could be good quality of life changes.

  1. Fixed 4328
  2. Removed border visual noise.
  3. Fixed text tool spawning. I'll add video description of it as it is somewhat confusing to describe in text. But now this commit makes it function similar to tools like excalidraw and eraser.

Also AI Disclosure: I used it to understand code and identify pain points, also to write parts of it but those parts are now deleted as they were for an entirely wrong issue but now the fix is back in the correct direction.

@thermalPasteMilkshake thermalPasteMilkshake changed the title Addressing #4328 Some Suggested Improvements for Text Tool Jul 23, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 3 files (changes from recent commits).

Confidence score: 3/5

  • In editor/src/messages/tool/tool_messages/text_tool.rs, hit testing uses the layer’s rendered/graph text bounds while edit mode displays content from tool_data.new_text, so clicks can miss the actual visible text area and cause unreliable selection/edit interactions; align hit testing with the live edit buffer bounds during editing to de-risk regressions.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="editor/src/messages/tool/tool_messages/text_tool.rs">

<violation number="1" location="editor/src/messages/tool/tool_messages/text_tool.rs:488">
P2: Clicks are tested against the layer's rendered/graph text bounds even though editing hides that text and the live content is stored in `tool_data.new_text`. The hit test therefore does not reliably cover the visible editable textbox, so clicking within the editor can incorrectly trigger the outside-click path. The bounds should be derived from the active editing text and its current `new_text` (using the same coordinate transform as the overlay).</violation>
</file>

Tip: cubic used a learning from your PR history. Let your coding agent read cubic learnings directly with the cubic MCP.

Re-trigger cubic

Comment thread editor/src/messages/tool/tool_messages/text_tool.rs Outdated

let quad =
document.metadata().transform_to_viewport(self.layer)
* text_bounding_box(self.layer, document, fonts, responses);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Clicks are tested against the layer's rendered/graph text bounds even though editing hides that text and the live content is stored in tool_data.new_text. The hit test therefore does not reliably cover the visible editable textbox, so clicking within the editor can incorrectly trigger the outside-click path. The bounds should be derived from the active editing text and its current new_text (using the same coordinate transform as the overlay).

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At editor/src/messages/tool/tool_messages/text_tool.rs, line 488:

<comment>Clicks are tested against the layer's rendered/graph text bounds even though editing hides that text and the live content is stored in `tool_data.new_text`. The hit test therefore does not reliably cover the visible editable textbox, so clicking within the editor can incorrectly trigger the outside-click path. The bounds should be derived from the active editing text and its current `new_text` (using the same coordinate transform as the overlay).</comment>

<file context>
@@ -471,6 +471,27 @@ struct TextToolData {
+
+        let quad =
+            document.metadata().transform_to_viewport(self.layer)
+            * text_bounding_box(self.layer, document, fonts, responses);
+
+        !quad.contains(mouse)
</file context>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Select tool double click text to edit in shallow select mode

1 participant